package com.bw.controller;

import com.bw.entity.TbAdm;
import com.bw.entity.TbUserTem;
import com.bw.entity.vo.Admvo;
import com.bw.service.AdmService;
import com.bw.service.UserTemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@SuppressWarnings("all")
public class AdmController {
    @Autowired
    private AdmService admService;
    //用户管理列表
    @GetMapping("admlist")
    List<Admvo> admlist(@RequestParam("mohu")String mohu){
        return admService.admlist(mohu);
    }
    //批量删除
    @PostMapping("del")
    String[] del(@RequestParam("id") String id){
        return admService.del(id);
    }
    //添加
    @PostMapping("admadd")
    TbUserTem admadd(@RequestBody TbAdm adm){
        return admService.admadd(adm);
    }
    //修改
    @PostMapping("admupdate")
    TbAdm admupdate(@RequestBody TbAdm adm){
        return admService.admupdate(adm);
    }
    //回显
    @GetMapping("findByAdmid")
    TbAdm findByAdmid(@RequestParam("id")int id){
        return admService.findByAdmid(id);
    }
}
